#include<bits/stdc++.h>
#define ll long long 
using namespace std;
namespace IO{
    char buff[1<<21],*p1=buff,*p2=buff;
    char getch(){
        return p1==p2&&(p2=((p1=buff)+fread(buff,1,1<<21,stdin)),p1==p2)?EOF:*p1++;
    }
    template<typename T>
    void read(T &x){
        char ch=getch();int fl=1;x=0;
        while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getch();}
        while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getch();}
        x*=fl;
    }
    template<typename T,typename ...Args>
    void read(T &x,Args& ...args){
        read(x);read(args...);
    }
    char obuf[1<<21],*p3=obuf;
    void putch(char ch){
        if(p3-obuf<(1<<21))*p3++=ch;
        else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;
    }
    void pc(const char *s){
    	while(*s)putch(*s),s++;
    }
    char ch[100];
    template<typename T>
    void write(T x){
        if(!x)return putch('0');
        if(x<0)putch('-'),x*=-1;
        int top=0;
        while(x)ch[++top]=x%10+48,x/=10;
        while(top)putch(ch[top]),top--;
    }
    template<typename T,typename ...Args>
    void write(T x,Args ...args){
        write(x),putch(' '),write(args...);
    }
    void flush(){fwrite(obuf,p3-obuf,1,stdout);}
}
using namespace IO;
const int N=2e5+5,V=10;
const ll Inf=1e18;
int n;
struct Point{
	ll x,y;
	bool operator <(Point A){return x!=A.x?x<A.x:y<A.y;}
	Point operator -(Point A){return Point{x-A.x,y-A.y};}
	ll operator *(Point A){return 1ll*x*A.y-1ll*A.x*y;}
};
struct Convex{
	int tot=-1;
	vector<Point>st;
	void Out(){
		for(int i=0;i<=tot;i++)cout<<'('<<st[i].x<<','<<st[i].y<<") ";cout<<'\n'; 
	}
	void Init(){
		tot=-1;
		st.clear();
	}
	void Insert(Point x){
		if(tot<1){
			tot++;st.push_back(x);
			return;
		}
		while(tot>=1&&(st[tot]-st[tot-1])*(x-st[tot])<=0){tot--;st.pop_back();}
		tot++;st.push_back(x);
		return;
	}
	inline ll calc(int y){
		if(tot==-1)return Inf;
		Out();
		int l=0,r=tot;
		while(l<r){
			int mid=((l+r)>>1);
			if(1ll*(st[mid].x-st[mid+1].x)<=1ll*y*(st[mid+1].y-st[mid].y))r=mid;
			else l=mid+1;
		}
		cout<<y<<':'<<r<<'\n';
		return 1ll*st[r].x+1ll*y*st[r].y;
	}
}tree[N];
inline int lowbit(int x){return x&(-x);}
inline void add(int x,Point y){
	while(x<=V){
		tree[x].Insert(y);
		x+=lowbit(x);
	}
}
inline ll ask(int x,int y){
	ll ans=Inf;
	while(x){
		ans=max(ans,tree[x].calc(y));
		x-=lowbit(x);
	}
	return ans;
}
inline void Clear(int x){
	while(x<=V){
		tree[x].Init();
		x+=lowbit(x);
	}
}
struct node{
	int a,h;
}p[N];
int st[N],tot;
ll sum[N],f[N];
int id[N];
void sol(int l,int r){
	if(l==r)return;
	int mid=((l+r)>>1);
	sol(l,mid);
	sort(id+l,id+mid+1,[](int A,int B){return f[A]-sum[A]<f[B]-sum[B];});
	for(int i=l;i<=mid;i++){
		for(int j=1;;j++){
			add(V-min(p[st[id[i]]].a*j,V)+1,Point{f[id[i]]-sum[id[i]],j});
			if(p[st[id[i]]].a*j>=V)break;
		}
	}
	for(int i=mid+1;i<=r;i++)f[i]=ask(V-p[st[i]].h+1,p[st[i]].a)+sum[i-1]-p[st[i]].a;
	for(int i=l;i<=mid;i++){
		for(int j=1;;j++){
			Clear(V-min(p[st[id[i]]].a*j,V)+1);
			if(p[st[id[i]]].a*j>=V)break;
		}
	}
	sol(mid+1,r);
}
signed main(){
	freopen("xinyue.in","r",stdin);
//	freopen("xinyue.out","w",stdout);
	read(n,p[0].a);
	for(int i=1;i<=n;i++)read(p[i].a,p[i].h);
	sort(p+1,p+n+1,[](node A,node B){return A.a==B.a?A.h<B.h:A.a<B.a;});
	ll tmp=0;
	for(int i=1;i<=n;i++){
		if(p[i].a<=p[0].a){
			tmp+=(((p[i].h+p[n].a-1)/p[n].a)-1)*p[i].a;
		}else{
			if(i==1||p[i].a!=p[i-1].a)st[++tot]=i;
			else tmp+=(((p[i].h+p[n].a-1)/p[n].a)-1)*p[i].a;
		}
	}
	for(int i=1;i<=tot;i++)sum[i]=sum[i-1]+(((p[st[i]].h+p[n].a-1)/p[n].a)-1)*p[st[i]].a;
	memset(f,0x3f,sizeof f);f[0]=0;
	for(int i=0;i<=tot;i++)id[i]=i;
	sol(0,tot);
	write(f[tot]+tmp);
	flush();
	return 0;
}/*
4 1
3 2
4 4
5 6
1 6

*/

